#ifndef __TASKQUEUE_H_
#define __TASKQUEUE_H_
#include"Mutexlock.h"
#include"Condition.h"

#include<functional>
#include<queue>

namespace SC
{
    using Task = std::function<void()>;

    class TaskQueue : Noncopyable
    {
    public:
        TaskQueue(size_t size = 10)
        : _queuesize(size), _mutex(), _cond(_mutex), _ExitSig(false)
        {}

        bool isEmpty();
        bool isFull();
        void push(Task task);
        Task pop();
        void exit();

    private:
        std::queue<Task> _queue;
        size_t _queuesize;
        Mutexlock _mutex;
        Condition _cond;
        bool _ExitSig;
    };
}

#endif